﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using KTVConsole2.Core;

namespace KTVConsole2.UI
{
    /// <summary>
    /// Interaction logic for UserControlSongPlayedDisplayBySong.xaml
    /// </summary>
    public partial class UserControlSongPlayedDisplayBySong : UserControl
    {
        //SongPlayedManager sm = SongPlayedManager.GetInstance();   
        public UserControlSongPlayedDisplayBySong()
        {
            InitializeComponent();
        }

        private void BtnDelete_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;
            var sp = btn.Tag as SongPlayed;
            MainWindow.Sm.DeleteSong(sp);            
        }

        private void BtnPlay_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;
            btn.IsEnabled = false;
            var sp = btn.Tag as SongPlayed;
            MainWindow.Engine.AddSongToPlayList(sp.Song);
            listView1.SelectedItem = sp;            
        }
    }
}
